﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace NJL.Web
{
    public partial class Notice :BasePageVisitor
    {
        public string title;
        NJL.BLL.NJL_SYS_ANNOUNCEMENT bll = new BLL.NJL_SYS_ANNOUNCEMENT();
        NJL.Model.NJL_SYS_ANNOUNCEMENT model;
        private readonly BLL.NJL_SYS_NEWS bllSysNews = new BLL.NJL_SYS_NEWS();
        protected IList<Model.NJL_SYS_NEWS> LIST_SYS_NEWS;
        protected void Page_Load(object sender, EventArgs e)
        {
            LIST_SYS_NEWS = bllSysNews.GetModelList(8, " NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' AND TYPE_CODE>20 AND IS_PUBLISH=1 ", "PUBLISH_DATE_TIME DESC");
            if (!IsPostBack)
            {
                bind();
            }
        }
        void bind()
        {  
            model = bll.GetModel(Request.QueryString["id"].ToString());
            if (model.ANNOUNCEMENT_NAME.Length > 20)
            {
                litTitle.Text = model.ANNOUNCEMENT_NAME.Substring(0, 20);
            }
            else
            {
                litTitle.Text = model.ANNOUNCEMENT_NAME;
            }
            title = model.ANNOUNCEMENT_NAME;
            litDateTime.Text = model.CREATE_DATE_TIME.ToString();
            litContent.Text = model.ANNOUNCEMENT_CONTENT;
        }
    }
}